package com.example.factory.core.domain;

import org.apache.commons.collections4.CollectionUtils;

import javax.persistence.*;
import java.util.List;

/**
 * @author Lei Tao
 */
@Entity
@Table(name = "level_2_dimension")
public class Level2Dimension extends DomainObject{
    private String name;
    /**
     * 评分细则描述
     */
    private String description;

    private int min;

    private int max;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "level_1_dimension_id")
    private Level1Dimension level1Dimension;

    @OneToMany(fetch = FetchType.LAZY,mappedBy = "level2Dimension",orphanRemoval = true)
    private List<ReportLevel2Dimension> reportLevel2Dimensions;

    public Level2Dimension() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Level1Dimension getLevel1Dimension() {
        return level1Dimension;
    }

    public void setLevel1Dimension(Level1Dimension level1Dimension) {
        this.level1Dimension = level1Dimension;
    }

    public int getMin() {
        return min;
    }

    public void setMin(int min) {
        this.min = min;
    }

    public int getMax() {
        return max;
    }

    public void setMax(int max) {
        this.max = max;
    }

    public List<ReportLevel2Dimension> getReportLevel2Dimensions() {
        return reportLevel2Dimensions;
    }

    public void setReportLevel2Dimensions(List<ReportLevel2Dimension> reportLevel2Dimensions) {
        this.reportLevel2Dimensions = reportLevel2Dimensions;
    }
}
